<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'${button.icon!}',plain:true" onclick="eova_add()"> ${button.name!} </a>
<script type="text/javascript">
	var eova_add = function() {
		var $treegrid = $('#treegrid');
		var row = $.getWidgetSelected($treegrid);
		if (row && row.type != 'dir') {
			$.slideMsg("只能选择目录才可以新增，不选默认新增到根目录！");
			return;
		}
		// 默认新增到根下
		var menuId = 0;
		if (row != null) {
			menuId = row.id;
		}
		
		var param = "?parent_id=" + menuId;
		
		if(menuId == 0){
			$.messager.confirm("请先选中一行数据作为当前新增菜单的父目录", "如不选择本次新增的菜单将默认新增到根节点下,确认继续？", function(ok) {
				if (!ok) {
					return;
				}
				loadDialog($treegrid, '新功能配置', '/menu/toAdd' + param, 1100);
			});
			return;
		}
		loadDialog($treegrid, '新功能配置', '/menu/toAdd' + param, 1100);
	};
</script>